import sys
from PyQt5.QtWidgets import QApplication, QWidget,\
    QPushButton, QToolTip
from PyQt5.QtGui import QFont

class Example(QWidget):

    def __init__(this):
        super().__init__()
        this.initUI()

    def initUI(this):
        this.setGeometry(100, 100, 300, 400)
        this.setWindowTitle('Tooltip Test')

        QToolTip.setFont(QFont('Ubuntu', 12))
        this.setToolTip('This is a <b>QWidget</b> widget')

        btn = QPushButton('Button', this)
        btn.setToolTip('This is a <b>QPushButton</b> widget')
        btn.resize(btn.sizeHint())
        btn.move(50,50)

        this.show()



if __name__ == '__main__':

    app = QApplication(sys.argv)
    win = Example()
    sys.exit(app.exec_())
